1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module adw.ApplicationWindow;
26 
27 private import adw.c.functions;
28 public  import adw.c.types;
29 private import glib.ConstructionException;
30 private import gobject.ObjectG;
31 private import gtk.AccessibleIF;
32 private import gtk.AccessibleT;
33 private import gtk.Application;
34 private import gtk.ApplicationWindow : DGtkApplicationWindow = ApplicationWindow;
35 private import gtk.BuildableIF;
36 private import gtk.BuildableT;
37 private import gtk.ConstraintTargetIF;
38 private import gtk.ConstraintTargetT;
39 private import gtk.NativeIF;
40 private import gtk.NativeT;
41 private import gtk.RootIF;
42 private import gtk.RootT;
43 private import gtk.ShortcutManagerIF;
44 private import gtk.ShortcutManagerT;
45 private import gtk.Widget;
46 
47 
48 /**
49  * A freeform application window.
50  * 
51  * <picture>
52  * <source srcset="application-window-dark.png" media="(prefers-color-scheme: dark)">
53  * <img src="application-window.png" alt="application-window">
54  * </picture>
55  * 
56  * `AdwApplicationWindow` is a [class@Gtk.ApplicationWindow] subclass providing
57  * the same features as [class@Window].
58  * 
59  * See [class@Window] for details.
60  * 
61  * Using [property@Gtk.Application:menubar] is not supported and may result in
62  * visual glitches.
63  *
64  * Since: 1.0
65  */
66 public class ApplicationWindow : DGtkApplicationWindow
67 {
68 	/** the main Gtk struct */
69 	protected AdwApplicationWindow* adwApplicationWindow;
70 
71 	/** Get the main Gtk struct */
72 	public AdwApplicationWindow* getAdwApplicationWindowStruct(bool transferOwnership = false)
73 	{
74 		if (transferOwnership)
75 			ownedRef = false;
76 		return adwApplicationWindow;
77 	}
78 
79 	/** the main Gtk struct as a void* */
80 	protected override void* getStruct()
81 	{
82 		return cast(void*)adwApplicationWindow;
83 	}
84 
85 	/**
86 	 * Sets our main struct and passes it to the parent class.
87 	 */
88 	public this (AdwApplicationWindow* adwApplicationWindow, bool ownedRef = false)
89 	{
90 		this.adwApplicationWindow = adwApplicationWindow;
91 		super(cast(GtkApplicationWindow*)adwApplicationWindow, ownedRef);
92 	}
93 
94 	/**
95 	 * You should use `setContent(Widget)` instead
96 	 */
97 	override void setChild(Widget child)
98 	{
99 		setContent(child);
100 	}
101 
102 	/**
103 	 */
104 
105 	/** */
106 	public static GType getType()
107 	{
108 		return adw_application_window_get_type();
109 	}
110 
111 	/**
112 	 * Creates a new `AdwApplicationWindow` for @app.
113 	 *
114 	 * Params:
115 	 *     app = an application instance
116 	 *
117 	 * Returns: the newly created `AdwApplicationWindow`
118 	 *
119 	 * Since: 1.0
120 	 *
121 	 * Throws: ConstructionException GTK+ fails to create the object.
122 	 */
123 	public this(Application app)
124 	{
125 		auto __p = adw_application_window_new((app is null) ? null : app.getGtkApplicationStruct());
126 
127 		if(__p is null)
128 		{
129 			throw new ConstructionException("null returned by new");
130 		}
131 
132 		this(cast(AdwApplicationWindow*) __p);
133 	}
134 
135 	/**
136 	 * Gets the content widget of @self.
137 	 *
138 	 * This method should always be used instead of [method@Gtk.Window.get_child].
139 	 *
140 	 * Returns: the content widget of @self
141 	 *
142 	 * Since: 1.0
143 	 */
144 	public Widget getContent()
145 	{
146 		auto __p = adw_application_window_get_content(adwApplicationWindow);
147 
148 		if(__p is null)
149 		{
150 			return null;
151 		}
152 
153 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) __p);
154 	}
155 
156 	/**
157 	 * Sets the content widget of @self.
158 	 *
159 	 * This method should always be used instead of [method@Gtk.Window.set_child].
160 	 *
161 	 * Params:
162 	 *     content = the content widget
163 	 *
164 	 * Since: 1.0
165 	 */
166 	public void setContent(Widget content)
167 	{
168 		adw_application_window_set_content(adwApplicationWindow, (content is null) ? null : content.getWidgetStruct());
169 	}
170 }